x=10
y=3
z=x/y
print(z,type(z))

print('float类型转成int类型:',int(3.14))
print('float类型转成int类型:',int(3.9))
print('float类型转成int类型:',int(-3.14))
print('float类型转成int类型:',int(-3.9))

print('将int转成float类型:',float(10))
print(int('100')+int('200'))
# 将字符串转成int或float时报错的情况
#print(int('18a')) # ValueError: invalid literal for int() with base 10: '18a'
#print(int('3.14')) # ValueError: invalid literal for int() with base 10: '3.14'
#print(float('45a.987')) # ValueError: could not convert string to float: '45a.987'

print(ord('x'))
print(chr(120))

print('十进制转成十六进制:',hex(120))
print('十进制转成八进制:',oct(120))
print('十进制转成二进制:',bin(120))